<template>
  <div class="city-icon" @click="$router.push('/cities')">
    <!-- 城市名称 -->
    <span>{{ cityName }}</span>
    <!-- 下拉图标 -->
    <i class="iconfont icon-xia"></i>
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  name: 'CityIcon',
  computed: {
    /*  */
    ...mapState('CityModule', ['cityName'])
  }
}
</script>

<style lang="scss" scoped>
.city-icon {
  height: 30px;
  position: absolute;
  top: 18px;
  left: 8px;
  color: #fff;
  z-index: 10;
  background: rgba(0, 0, 0, 0.2);
  line-height: 30px;
  border-radius: 15px;
  text-align: center;
  padding: 0 5px;
  box-sizing: border-box;
  font-size: 0;
  cursor: pointer;
  span {
    display: inline-block;
    font-size: 13px;
  }
  i {
    display: inline-block;
    font-size: 12px;
    transform: scale(0.6);
  }
}
</style>
